<?php
/**
 * The Header for our theme.
 * @author Mr Rony<mrtrandangtrinh@gmail.com>
 */

global $sTemplateURL;
$sTemplateURL = get_template_directory_uri();

define('HTML_MODE', (!empty($_GET['htmlmode']) ? '' : '.min') );

?><!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6 lt-ie9 lt-ie8 lt-ie7" <?php language_attributes(); ?>> <![endif]-->
<!--[if IE 7]>    <html class="no-js ie7 lt-ie9 lt-ie8" <?php language_attributes(); ?>> <![endif]-->
<!--[if IE 8]>    <html class="no-js ie8 lt-ie9" <?php language_attributes(); ?>> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js gt-ie8" <?php language_attributes(); ?>> <!--<![endif]-->
<head>
    <meta charset="<?php bloginfo( 'charset' ); ?>" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

    <title><?php
    /*
     * Print the <title> tag based on what is being viewed.
     */
    global $page, $paged;

    wp_title( '|', true, 'right' );

    // Add the blog name.
    bloginfo( 'name' );

    // Add the blog description for the home/front page.
    $site_description = get_bloginfo( 'description', 'display' );
    if ( $site_description && ( is_home() || is_front_page() ) )
        echo " | {$site_description}";

    // Add a page number if necessary:
    if ( $paged >= 2 || $page >= 2 )
        echo ' | ' . sprintf( __( 'Page %s', 'twentyeleven' ), max( $paged, $page ) );

    ?></title>
    <meta name="description" content="" />
    <meta name="author" content="" />

    <meta name="viewport" content="width=device-width" />

	<!-- if page is content page -->  
	<?php if (is_single()) { ?>
    <?php if (have_posts()):while(have_posts()):the_post(); endwhile; endif;?>  
    <meta property="og:url" content="<?php the_permalink() ?>"/>  
    <meta property="og:title" content="<?php single_post_title(''); ?>" />  
    <meta property="og:description" content="<?php echo get_the_excerpt(); ?>" />  
    <meta property="og:type" content="article" />  
    <meta property="og:image" content="<?php if (function_exists('wp_get_attachment_thumb_url')) {echo wp_get_attachment_thumb_url(get_post_thumbnail_id($post->ID)); }?>" />  
      
    <!-- if page is others -->  
    <?php } else { ?>  
    <meta property="og:site_name" content="<?php bloginfo('name'); ?>" />  
    <meta property="og:description" content="<?php bloginfo('description'); ?>" />  
    <meta property="og:type" content="website" />  
    <meta property="og:image" content="<?php echo get_stylesheet_directory_uri(); ?>/img/logo.png" /> <?php } ?>	
	
    <?php $options = get_option( 'mobileshop_theme_options' ); ?>
    
    <link rel="shortcut icon" href="<?php echo $options['favicon']; ?>" />
	
    <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800&subset=vietnamese' rel='stylesheet' type='text/css'>
    
    <link rel="profile" href="http://gmpg.org/xfn/11" /> 
    <link rel="stylesheet" href="<?php echo get_bloginfo( 'stylesheet_directory' ); ?>/css/bootstrap<?php echo HTML_MODE; ?>.css">
	<link rel="stylesheet" href="<?php echo get_bloginfo( 'stylesheet_directory' ); ?>/font-awesome/css/font-awesome<?php echo HTML_MODE; ?>.css">
	
    <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>?v=1" />

    <?php $class = !empty($_GET['debug']) ? ' debug' : '';
    if( $class != '' ) : ?>
    <link rel="stylesheet" type="text/css" media="all" href="<?php echo get_bloginfo( 'stylesheet_directory' ); ?>/css/debug.css?v=1" />
    <?php endif; ?>

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="<?php echo get_bloginfo( 'stylesheet_directory' ); ?>/js/assets/html5shiv.js"></script>
      <script src="<?php echo get_bloginfo( 'stylesheet_directory' ); ?>/js/assets/respond.min.js"></script>
    <![endif]-->
	<!--[if IE 7]>
	<link rel="stylesheet" href="<?php echo get_bloginfo( 'stylesheet_directory' ); ?>/font-awesome/css/font-awesome-ie7.min.css">
	<![endif]-->
	
    <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
    <script src="<?php echo get_bloginfo( 'stylesheet_directory' ); ?>/js/vendor/modernizr-2.6.2-respond-1.1.0.min.js"></script>

<?php
    /* We add some JavaScript to pages with the comment form
     * to support sites with threaded comments (when in use).
     */
    if ( is_singular() && get_option( 'thread_comments' ) )
        wp_enqueue_script( 'comment-reply' );

    /* Always have wp_head() just before the closing </head>
     * tag of your theme, or you will break many plugins, which
     * generally use this hook to add elements to <head> such
     * as styles, scripts, and meta tags.
     */
    wp_head();
?>

<?php echo $options['headerscript']; ?>

</head>

<body <?php body_class($class); ?>>
	<!--[if lt IE 7]>
        <p class="chromeframe">You are using an outdated browser. <a href="http://browsehappy.com/">Upgrade your browser today</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to better experience this site.</p>
    <![endif]-->
	<div id="container">
		<header>
			<!-- begin section.wraper -->
			<section class="container">
				
				<!-- Static navbar -->
				<div class="navbar">
					<div class="navbar-header">
						<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
							<span class="icon-bar"></span>
							<span class="icon-bar"></span>
							<span class="icon-bar"></span>
						</button>
						<a href="<?php echo home_url(); ?>" class="logo-woodgift">
							<img src="<?php echo $options['imglogo']; ?>">
						</a>
						<div class="shopping_bag">
							<?php woo_nav_before(); ?>
						</div>
					</div>
					<div class="navbar-collapse collapse">
						<?php $menuHeader = array(
							'theme_location' => 'header',
							'items_wrap' => '<ul class="nav navbar-nav navbar-right">%3$s</ul>'
						);?>
						<?php wp_nav_menu($menuHeader); ?>
					</div><!--/.nav-collapse -->
				</div>
				<div class="banner">
					<ul class="banner-header">
						<?php $iPageID = get_page_by_path('home')->ID; ?>
						<?php $aBanner = get_field('_banner', $iPageID); ?>
						<?php if (!empty($aBanner)) : ?>
							<?php foreach ($aBanner as $aSlide) : ?>
							<?php $iIDImg = $aSlide['_image']; ?>
							<?php $aLinkImg = wp_get_attachment_image_src($iIDImg, 'image-banner'); ?>
							<li class="item">
								<a href="<?php echo home_url(); ?>">
									<img src="<?php echo $aLinkImg[0]; ?>">
								</a>
							</li>
							<?php endforeach; ?>
						<?php endif; ?>
					</ul>
					<div class="nav">
						<a id="prev-banner" href="#"><?php _e("Prev"); ?></a>
						<a id="next-banner" href="#"><?php _e("Next"); ?></a>
					</div>
				</div>

			</section><!-- end section.wraper -->
		</header><!-- end header -->

		<!-- main body of #main -->
		<div id="main" role="main">
			<!-- begin of section.wraper -->
			<section class="container">
